\documentclass[10pt,a4paper]{article} 

\usepackage{ctex} % 中文支持
\usepackage[top=2.5cm, bottom=2.5cm, left=2.5cm, right=2.5cm]{geometry} % 页边距
\usepackage{amsmath, amssymb} % 数学公式与符号
\usepackage{graphicx}
\usepackage{pythonhighlight}
\usepackage{url} 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{titling}
\setlength{\droptitle}{-2cm} % 标题上移

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 插入另一个文档中的python代码
\usepackage{listings}
\usepackage{color}

% 设置列表的样式
\definecolor{codegreen}{rgb}{0,0.6,0}
\definecolor{codegray}{rgb}{0.5,0.5,0.5}
\definecolor{codepurple}{rgb}{0.58,0,0.82}
\definecolor{backcolour}{rgb}{0.95,0.95,0.92}

\lstdefinestyle{mystyle}{
    backgroundcolor=\color{backcolour},   
    commentstyle=\color{codegreen},
    keywordstyle=\color{magenta},
    numberstyle=\tiny\color{codegray},
    stringstyle=\color{codepurple},
    basicstyle=\ttfamily\footnotesize,
    breakatwhitespace=false,         
    breaklines=true,                 
    captionpos=b,                    
    keepspaces=true,                 
    numbers=left,                    
    numbersep=5pt,                  
    showspaces=false,                
    showstringspaces=false,
    showtabs=false,                  
    tabsize=2
}

\lstset{style=mystyle}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%文档的题目、作者与日期
\author{五六七 }
\title{一杯热水是怎么慢慢变凉的 }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}

\maketitle

\begin{abstract}
物体放在空气中慢慢冷却，计算温度随时间的函数表达式。
\end{abstract}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\setcounter{tocdepth}{2}
%\renewcommand\contentsname{目录}
%
%\renewcommand {\baselinestretch} {1.3}\normalsize 
%\tableofcontents 
%\renewcommand {\baselinestretch} {1.0}\normalsize


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\section{问题描述}

设室温为20度。将一杯热水放在空气中，初始温度为100度。20分钟后测得温度为60度。

\begin{enumerate}
\item  计算温度关于时间的函数表达式，并求什么时候水温降到30度？
\item  实验测量数据，验证牛顿关于冷却的定律。
\end{enumerate}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\section{建立模型}
设这杯水在时刻 $t$ 时的温度为 $u(t)$, 根据牛顿冷却定律，当物体表面与周围环境存在温度差时，单位时间内改变的温度与环境的温度差成正比，设比例系数为 $k$, 可得
\begin{eqnarray}
\frac{du}{dt} = -k (u-20). 
\end{eqnarray}

为了求解这个微分方程，我们分离变量，可得
\begin{eqnarray}
\frac{du}{u-20} = -k dt. 
\end{eqnarray}
因为热水的初始温度大于空气温度，所以对 $t>0$ 总有 $u(t)>20$, 于是两边积分，可得
\begin{eqnarray}
\ln(u-20) = -kt + C,  
\end{eqnarray}
其中 $C$ 是待定的常数。

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\section{数值计算}
代入 $u(0)=100$ 与 $u(20)=60$, 可得两个方程
\begin{eqnarray}
\left\{\begin{array}{rcl}
\ln(100-20) &=& -k(0) + C, \\ 
\ln(60-20) &=& -k(20) + C. 
\end{array}\right. 
\end{eqnarray}
由此求得
\begin{eqnarray}
C = \ln(80), \,\, k=\frac{\ln(80)-\ln(40)}{20} = \frac{\ln(2)}{20}. 
\end{eqnarray}

最后可得水温与时间的函数关系为
\begin{eqnarray}
u(t) = 20 + e^Ce^{-kt} = 20 + 80e^{-\frac{\ln (2)}{20}t} = 20 + 80(2)^{-\frac{t}{20}}. 
\end{eqnarray}

当水温为30度时，有等式
\begin{eqnarray}
 20 + 80(2)^{-\frac{t}{20}} = 30. 
\end{eqnarray}
化简可得 
\begin{eqnarray}
(2)^{-\frac{t}{20}} = \frac{10}{80}. 
\end{eqnarray}
求得 
\begin{eqnarray}
\frac{t}{20} = 3. 
\end{eqnarray}
即 $t=60$ 分钟后，水温为30度。

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\section{实验测量}



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\section{回答问题}
水温与时间的函数关系式为 
最后可得水温与时间的函数关系为
\begin{eqnarray}
u(t) = 20 + 80(2)^{-\frac{t}{20}}. 
\end{eqnarray}
并且在60分钟之后，水温变为30度。水温与时间的函数图像见图1.

\begin{figure}[ht!]\centering
\includegraphics [height=6cm, width=10cm]{mme2024-example-8-1.png}
\caption{水温与时间的函数关系图 }
\end{figure}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\section{参考文献 }
\begin{thebibliography}{99}
\bibitem{dingtongren} 丁同仁、李承治，\emph{常微分方程教程}，高等教育出版社，2022年3月第3版。
\bibitem{sishoukui-2} 司守奎,孙玺菁. \emph{Python数学建模算法与应用}, 国防工业出版社. 2022年1月第1版. 

\end{thebibliography}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section*{附录}

下述程序画出函数图像。

\lstinputlisting[language=Python]{mme2024-example-8-1.py}



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\end{document}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%





